package jam4j.lang;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import jam4j.ActionDef;

public class ScriptActionDef implements ActionDef {
    private final ActionType type;
    private final List<ScriptTargetDef> targets, sourceTargets;
    
    ScriptActionDef(ActionType type, ScriptTargetDef[] targets,
            ScriptTargetDef[] sourceTargets) {
        this.type = type;
        
        this.targets = new ArrayList<ScriptTargetDef>();
        Collections.addAll(this.targets, targets);
        
        this.sourceTargets = new ArrayList<ScriptTargetDef>();
        Collections.addAll(this.sourceTargets, sourceTargets);
    }
    
    public ActionType type() {
        return type;
    }
    
    public List<ScriptTargetDef> targets() {
        return targets;
    }

    public List<ScriptTargetDef> sourceTargets() {
        return sourceTargets;
    }
}
